package com.lanou.horo.myapplication.dbdao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.lanou.horo.myapplication.dbdao.PersonEntity;
import com.lanou.horo.myapplication.dbdao.RecommendDbEntity;
import com.lanou.horo.myapplication.dbdao.FristTopDbEntity;
import com.lanou.horo.myapplication.dbdao.HostDbEntity;
import com.lanou.horo.myapplication.dbdao.FousDbEntity;
import com.lanou.horo.myapplication.dbdao.FristDbEntity;
import com.lanou.horo.myapplication.dbdao.HistoryEntity;
import com.lanou.horo.myapplication.dbdao.CollectionDBEntity;

import com.lanou.horo.myapplication.dbdao.PersonEntityDao;
import com.lanou.horo.myapplication.dbdao.RecommendDbEntityDao;
import com.lanou.horo.myapplication.dbdao.FristTopDbEntityDao;
import com.lanou.horo.myapplication.dbdao.HostDbEntityDao;
import com.lanou.horo.myapplication.dbdao.FousDbEntityDao;
import com.lanou.horo.myapplication.dbdao.FristDbEntityDao;
import com.lanou.horo.myapplication.dbdao.HistoryEntityDao;
import com.lanou.horo.myapplication.dbdao.CollectionDBEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig personEntityDaoConfig;
    private final DaoConfig recommendDbEntityDaoConfig;
    private final DaoConfig fristTopDbEntityDaoConfig;
    private final DaoConfig hostDbEntityDaoConfig;
    private final DaoConfig fousDbEntityDaoConfig;
    private final DaoConfig fristDbEntityDaoConfig;
    private final DaoConfig historyEntityDaoConfig;
    private final DaoConfig collectionDBEntityDaoConfig;

    private final PersonEntityDao personEntityDao;
    private final RecommendDbEntityDao recommendDbEntityDao;
    private final FristTopDbEntityDao fristTopDbEntityDao;
    private final HostDbEntityDao hostDbEntityDao;
    private final FousDbEntityDao fousDbEntityDao;
    private final FristDbEntityDao fristDbEntityDao;
    private final HistoryEntityDao historyEntityDao;
    private final CollectionDBEntityDao collectionDBEntityDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        personEntityDaoConfig = daoConfigMap.get(PersonEntityDao.class).clone();
        personEntityDaoConfig.initIdentityScope(type);

        recommendDbEntityDaoConfig = daoConfigMap.get(RecommendDbEntityDao.class).clone();
        recommendDbEntityDaoConfig.initIdentityScope(type);

        fristTopDbEntityDaoConfig = daoConfigMap.get(FristTopDbEntityDao.class).clone();
        fristTopDbEntityDaoConfig.initIdentityScope(type);

        hostDbEntityDaoConfig = daoConfigMap.get(HostDbEntityDao.class).clone();
        hostDbEntityDaoConfig.initIdentityScope(type);

        fousDbEntityDaoConfig = daoConfigMap.get(FousDbEntityDao.class).clone();
        fousDbEntityDaoConfig.initIdentityScope(type);

        fristDbEntityDaoConfig = daoConfigMap.get(FristDbEntityDao.class).clone();
        fristDbEntityDaoConfig.initIdentityScope(type);

        historyEntityDaoConfig = daoConfigMap.get(HistoryEntityDao.class).clone();
        historyEntityDaoConfig.initIdentityScope(type);

        collectionDBEntityDaoConfig = daoConfigMap.get(CollectionDBEntityDao.class).clone();
        collectionDBEntityDaoConfig.initIdentityScope(type);

        personEntityDao = new PersonEntityDao(personEntityDaoConfig, this);
        recommendDbEntityDao = new RecommendDbEntityDao(recommendDbEntityDaoConfig, this);
        fristTopDbEntityDao = new FristTopDbEntityDao(fristTopDbEntityDaoConfig, this);
        hostDbEntityDao = new HostDbEntityDao(hostDbEntityDaoConfig, this);
        fousDbEntityDao = new FousDbEntityDao(fousDbEntityDaoConfig, this);
        fristDbEntityDao = new FristDbEntityDao(fristDbEntityDaoConfig, this);
        historyEntityDao = new HistoryEntityDao(historyEntityDaoConfig, this);
        collectionDBEntityDao = new CollectionDBEntityDao(collectionDBEntityDaoConfig, this);

        registerDao(PersonEntity.class, personEntityDao);
        registerDao(RecommendDbEntity.class, recommendDbEntityDao);
        registerDao(FristTopDbEntity.class, fristTopDbEntityDao);
        registerDao(HostDbEntity.class, hostDbEntityDao);
        registerDao(FousDbEntity.class, fousDbEntityDao);
        registerDao(FristDbEntity.class, fristDbEntityDao);
        registerDao(HistoryEntity.class, historyEntityDao);
        registerDao(CollectionDBEntity.class, collectionDBEntityDao);
    }
    
    public void clear() {
        personEntityDaoConfig.getIdentityScope().clear();
        recommendDbEntityDaoConfig.getIdentityScope().clear();
        fristTopDbEntityDaoConfig.getIdentityScope().clear();
        hostDbEntityDaoConfig.getIdentityScope().clear();
        fousDbEntityDaoConfig.getIdentityScope().clear();
        fristDbEntityDaoConfig.getIdentityScope().clear();
        historyEntityDaoConfig.getIdentityScope().clear();
        collectionDBEntityDaoConfig.getIdentityScope().clear();
    }

    public PersonEntityDao getPersonEntityDao() {
        return personEntityDao;
    }

    public RecommendDbEntityDao getRecommendDbEntityDao() {
        return recommendDbEntityDao;
    }

    public FristTopDbEntityDao getFristTopDbEntityDao() {
        return fristTopDbEntityDao;
    }

    public HostDbEntityDao getHostDbEntityDao() {
        return hostDbEntityDao;
    }

    public FousDbEntityDao getFousDbEntityDao() {
        return fousDbEntityDao;
    }

    public FristDbEntityDao getFristDbEntityDao() {
        return fristDbEntityDao;
    }

    public HistoryEntityDao getHistoryEntityDao() {
        return historyEntityDao;
    }

    public CollectionDBEntityDao getCollectionDBEntityDao() {
        return collectionDBEntityDao;
    }

}
